package com.cn.aam.checaiduo.ui.me.command;

import com.cn.aam.checaiduo.AppData;
import com.cn.aam.checaiduo.backend.CommandV2;
import com.cn.aam.checaiduo.backend.RetrofitHome;
import com.cn.aam.checaiduo.backend.observer.OnRequestListV2Listener;
import com.cn.aam.checaiduo.backend.rx.RxSchedulers;
import com.cn.aam.checaiduo.bean.me.PointDetailB;
import com.cn.aam.checaiduo.bean.base.PageB;

/**
 * monker on 2017/6/20.
 */

public class PointDetailCommand extends CommandV2<PointDetailB> {
    private String year;
    private String type;
    private String startTime;

    public void setData(String year, String type, String startTime) {
        this.year = year;
        this.type = type;
        this.startTime=startTime;
    }

    @Override
    public void execute(String pageNumber, String pageSize, OnRequestListV2Listener<PointDetailB> observer) {
        RetrofitHome.getInstance()
                .getInternalApi()
                .getPointDetail(AppData.getToken(), pageNumber, pageSize, year, type,startTime,"")
                .compose(RxSchedulers.<PageB<PointDetailB>>toMain())
                .subscribe(observer);
    }
}
